package com.jzo2o.customer.controller.agency;

import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.response.RejectReasonResDTO;
import com.jzo2o.customer.service.AgencyCertficationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController("AgencyCertificationAudit")
@RequestMapping("/agency/agency-certification-audit")
@Api(tags = "机构端 - 提交认证")
public class CertificationAuditController {
    @Resource
    private AgencyCertficationAuditService agencyCertficationAuditService;

    @PostMapping
    @ApiOperation("机构端提交认证申请")
    public void certificationAudit(@RequestBody AgencyCertificationAuditAddReqDTO dto) {
        agencyCertficationAuditService.agencyCertificationAudit(dto);
    }

    @GetMapping(path = "/rejectReason")
    @ApiOperation("查询最新的驳回原因")
    public RejectReasonResDTO rejectReason() {
        String reson = agencyCertficationAuditService.agencyRejectReason();
        return new RejectReasonResDTO(reson);
    }
}
